package com.hean.activity;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;

public class Image extends Activity {
	private Button load;
	private ImageView image;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.loadimage);
		load = (Button) findViewById(R.id.image_load);
		image = (ImageView) findViewById(R.id.image_iv);

		load.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
//				Bitmap bm=BitmapFactory.decodeByteArray(data, offset, length)
				Bitmap bitmap = BitmapFactory
						.decodeFile("/mnt/sdcard/apple.jpg");
				image.setImageBitmap(bitmap);
			}
		});
	}
}
